<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('AdminModel/index')}">所有模型</a></li>
        <li><a href="{:url('AdminModel/add')}">添加模型</a></li>
    </ul>
    <form method="post" class="js-ajax-form margin-top-20" action="{:url('Link/listOrder')}">
        <div class="table-actions">
            <button class="btn btn-sm btn-success js-ajax-submit" type="submit"
                    data-action="{:url('AdminModel/toggle',array('display'=>1))}"
                    data-subcheck="true">启用
            </button>
            <button class="btn btn-sm btn-danger js-ajax-submit" type="submit"
                    data-action="{:url('AdminModel/toggle',array('hide'=>1))}"
                    data-subcheck="true">禁用
            </button>
        </div>
        <php>$status=array("1"=>"启用","0"=>"禁用");</php>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x"
                                             data-checklist="js-check-x"></label></th>
                <th width="50">ID</th>
                <th>名称</th>
                <th width="50">{:lang('STATUS')}</th>
                <th width="160">{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="models" item="vo">
                <tr>
                    <td>
                        <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
                               value="{$vo.id}">
                    </td>
                    <td>{$vo.id}</td>
                    <td>{$vo.name}</td>
                    <td>
                        <empty name="vo.status">
                            <span class="label label-default">
                                {$status[$vo['status']]}
                            </span>
                            <else/>
                            <span class="label label-success">
                                {$status[$vo['status']]}
                            </span>
                        </empty>
                    </td>
                    <td>
                        <a class="btn btn-xs btn-primary" href="{:url('AdminModel/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
                        <a class="btn btn-xs btn-primary" href="{:url('AdminModel/attrs',array('id'=>$vo['id']))}">属性管理</a>
                        <a class="btn btn-xs btn-danger" href="{:url('AdminModel/delete',array('id'=>$vo['id']))}"
                           class="js-ajax-delete">
                            {:lang('DELETE')}
                        </a>
                    </td>
                </tr>
            </foreach>
            </tbody>
            <tfoot>
            <tr>
                <th width="16">
                    <label>
                        <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                    </label>
                </th>
                <th width="50">ID</th>
                <th>名称</th>
                <th width="50">{:lang('STATUS')}</th>
                <th width="160">{:lang('ACTIONS')}</th>
            </tr>
            </tfoot>
        </table>
        <div class="table-actions">
            <button class="btn btn-sm btn-success js-ajax-submit" type="submit"
                    data-action="{:url('AdminModel/toggle',array('display'=>1))}"
                    data-subcheck="true">启用
            </button>
            <button class="btn btn-sm btn-danger js-ajax-submit" type="submit"
                    data-action="{:url('AdminModel/toggle',array('hide'=>1))}"
                    data-subcheck="true">禁用
            </button>
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>